import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    title: sessionStorage.getItem('title') || '任务执行人员登录',
    // [1:执行人员,2:管理人员]
    role: sessionStorage.getItem('role') || ''
  },
  mutations: {
    setTitle (state, info) {
      sessionStorage.setItem('title', info)
      state.title = info
    },
    setRole (state, info) {
      sessionStorage.setItem('role', info)
      state.role = info
    }
  },
  // actions: {},
  // modules: {},
});
